import {terser} from 'rollup-plugin-terser';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import webWorkerLoader from 'rollup-plugin-web-worker-loader';

export default [
  {
    input: 'src/leaflet.canvasCircle.js',
    output: {
      file: 'dist/leaflet.canvasCircle.js',
      format: 'umd',
      name: 'canvasCircle',
      sourcemap: true,
    },
    plugins: [resolve(), webWorkerLoader()],
  },
  {
    input: 'src/leaflet.canvasCircle.js',
    output: {
      file: 'dist/leaflet.canvasCircle.min.js',
      format: 'umd',
      name: 'canvasCircle',
      sourcemap: true,
    },
    plugins: [terser(), resolve(), webWorkerLoader()],
  },
  // node
  {
    input: 'src/leaflet.canvasCircle.js',
    output: {
      file: 'dist/leaflet.canvasCircle.cjs.js',
      format: 'cjs',
      name: 'canvasCircle',
      sourcemap: true,
    },
    plugins: [resolve(), commonjs(), webWorkerLoader()],
    external: ['dependency'],
  },
  {
    input: 'src/leaflet.canvasCircle.js',
    output: {
      file: 'dist/leaflet.canvasCircle.esm.js',
      format: 'esm',
      name: 'canvasCircle',
      sourcemap: true,
    },
    plugins: [resolve(), commonjs(), webWorkerLoader()],
    external: ['dependency'],
  },
];
